



<div class="x-body">
    <form class="layui-form form_single" action="{:url()}" method="post">

        <div class="layui-form-item">
            {if condition="$param['status'] eq -1"}
                <label for="password" class="layui-form-label">

                    取消原因
                </label>
                <div class="layui-input-block">
                    <textarea id="password" class="layui-textarea" name="password"    rows="10" placeholder="取消原因"></textarea>
                </div>
            {else/}
                <label for="password" class="layui-form-label">

                    卡密(会员卡无须填)
                </label>
                <div class="layui-input-block">
                    <textarea id="password" class="layui-textarea" name="password"    rows="10" placeholder="卡密(会员卡无须填) "></textarea>
                </div>
            {/if}
            <!--<div class="layui-form-mid layui-word-aux">-->
            <!--(文章描述信息/简介)-->
            <!--</div>-->
        </div>





        <div class="box-footer">

            <input type="hidden" name="id" value="{$param['id']|default='0'}"/>
            <input type="hidden" name="status" value="{$param['status']|default='0'}"/>
            <button type="button"  class="layui-btn ladda-button" data-style="slide-up"  onclick="save()">
                确 定
            </button>
            <a class="layui-btn ladda-button" onclick="javascript:cancel();return false;"><i class="fa fa-history"></i> 取 消</a>


        </div>

    </form>
</div>

<script>
    layui.use('laydate', function(){
        layer=layui.layer;
        //执行一个laydate实例
    });
    function save(){
        var id=$("[name='id']").val();
        var status=$("[name='status']").val();
        var password=$("[name='password']").val();
        $.post("{:url('applicationOrderConfirm')}",{id:id,password:password,status:status,match:1},function (d) {
            if(d.code==1){

                layer.msg(d.msg);
                setTimeout( function () {
                    var index = parent.layer.getFrameIndex(window.name);
                    parent.layer.close(index);//关闭当
                    parent.location.reload();
                },2000);

            }else{
                layer.msg(d.msg);
            }
        })
    }

    function cancel() {

        var index = parent.layer.getFrameIndex(window.name);
        parent.layer.close(index);//关闭当
    }

</script>